package oop6;

/**
 * @author oldliu
 * @since 1.0
 */
//usb硬盘
public  class HardDisk extends Disk implements Usb  {
    private String brandname;
    private int cap;//容量,以G作为单位

    public HardDisk(String brandname, int cap) {
        this.brandname = brandname;
        this.cap = cap;
    }

    @Override
    public String toString() {
        return "HardDisk{" +
                "品牌='" + brandname + '\'' +
                ", 容量=" + cap +
                "G}";
    }
    @Override
    public void write(String s){
        System.out.println(s+"写到了"+brandname+"硬盘上");
    }
    @Override
    public void read(){
        System.out.println("硬盘开始读取数据101939339");
    }
    @Override
    public void plugin() {
        System.out.println(this+"接上了电脑，开始工作了");
    }

    @Override
    public void unplug() {
        System.out.println(this+"从电脑上移除，停止了工作");
    }
}
